package com.killer.service;


import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

/**
 * @author ：Killer
 * @date ：Created in 20-12-16 上午10:10
 * @description：${description}
 * @modified By：
 * @version: version
 */
@Service
public class HelloServiceImpl implements HelloService {
    @Override
    public String sayHello(String name) {
        //从RpcContext（相当于ThreadLocal）获取对应的值
        System.out.println("web端请求的ip是:"+RpcContext.getContext().getAttachment("web-ip"));
        return "hello "+name;
    }
}
